Gcrypt (When this is loaded, basic init for the C library is run.)

x = Gcrypt.Hash(algo)
x.Add(data)
hash = x.Hash()
hash = x.HexHash()

"algo" for Hash() must currently be one of (as a string):
    SHA1, RMD160, MD5, TIGER


A = Gcrypt.Cipher(algo, mode, key, iv = None)
    ( gcry_cipher_open / gcry_cipher_setkey / 
      gcry_cipher_setiv / gcry_cipher_close )
ciphertext = x.Encrypt(plaintext)
    
plaintext = x.Decrypt(ciphertext)

"algo" for Cipher() must currently be one of:
    3DES, BLOWFISH-128, AES-128, AES-192, AES-256,
    TWOFISH-128, TWOFISH-256

"mode" for Cipher() must currently be one of:
    ECB, CBC, CBC-CTS

note: The N*0xN padding method is used, unless CTS
    is specified (i.e. if we need to pad "ABCDEF" to
    8 bytes, we use "ABCDEF\x02\x02")

Gcrypt.GenRandom(len, strength)
    where strength is one of
        0: call gcry_create_nonce
        1: call gcry_randomize with strength = strong
        2: call gcry_randomize with strength = super strong

===> Public Key Crypto

We can generate a keypair, or unserialize either type of key.

Given a Public Key:
    Encrypt, Verify, Serialize

Given a Private Key:
    Decrypt, Sign, Serialize

(pub, prv) = Gcrypt.PkGenerate(algo)
    Create a keypair. Returns PkPublic and PkPrivate objects.

"algo" for PkGenerate must be one of the following:
    RSA, ELGAMAL, DSA
    
pub = PkPublic(key)
    Creates from "key" a PkPublic Object. "key" contains
    the result of an earlier .Dump()ing.

ciphertext = pub.Encrypt(message)
    Encrypts message using the public key.

result = pub.Verify(message, sig)
    Verify a signature. "result" will be 1 for a valid
    signature or 0 for an invalid signature.

key = pub.Dump()
    Dumps the public key in some 7-bit safe platform
    independant format for later loading.

prv = PkPrivate(key)
    Creates from "key" a PkPublic Object. "key" contains
    the result of an earlier .Dump()ing.

message = prv.Decrypt(ciphertext)
    Decrypts message using private key.

sig = prv.Sign(message, algo = "SHA1")
    Creates a digital signature.
    "algo" is the hashing algorithim you want to use, defaulting
    to SHA1.

key = prv.Dump()
    Same as pub.Dump()
